<HTML><HEAD><TITLE>complement(?SetVar, ?Complement)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(cardinal)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>complement(?SetVar, ?Complement)</H1>
Set complement constraint
<DL>
<DT><EM>SetVar</EM></DT>
<DD>A variable.
</DD>
<DT><EM>Complement</EM></DT>
<DD>A variable
</DD>
</DL>
<H2>Description</H2>
Constrain sets so that Complement is the complement set of SetVar.
		(The universe is taken as the union of their LUBs.).
<H3>Fail Conditions</H3>
Fails if Complement can not be the set complement of SetVar (in their universe).
<H3>Resatisfiable</H3>
No.
<H2>Examples</H2>
<PRE>
?- complement([8,9], []), complement([8,9], [t]).
yes

?- complement([8,9], [8]).
no

?- complement([8,9], N).
N = []

?- sets([X,Y], [],[7,8,9], []), complement(X,Y), 8 `@ Y, glb_poss(X,GX,PX), glb_poss(Y,GY,PY).
GX = [], PX = [7,9], GY = [8], PY = [7,9]

?- sets([X,Y], [],[7,8,9], [cardinality:C]), complement(X,Y), card_labeling([X]).
no

?- sets([X,Y], [],[7,8,9], []), complement(X,Y), X `&gt;= Y, set_labeling(up,[Y]).
Y = [], X = [7,8,9] ;
no

?- sets([X,Y], [],[7,8,9], [minimum:Min]), complement(X,Y), refine(up,X).
no

?- sets([X,Y], [],[7,8,9], []), complement(X,Y), #(X,1), #(Y,CY).
CY = 2
</PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/cardinal/complement-3.html">complement / 3</A>, <A HREF="../../lib_public/cardinal/BS-2.html">`$ / 2</A>, <A HREF="../../lib_public/cardinal/BE-2.html">`= / 2</A>
</BODY></HTML>
